package edu.nf.ch08;

/**
 * @author CSY
 * @date 2025 - 04 - 17
 *
 */
public class Teacher {

    private Teacher(){}

    /**
     * 当调用get方法时，才初始化内部类实例化Teacher
     * @return
     */
    public static Teacher getInstance(){
        return InnerClass.instance;
    }

    /**
     * 静态内部类 - 内部创建一个外部类的常量实例
     */
    private static class InnerClass{
        private static final Teacher instance = new Teacher();
    }
}
